package com.action;

import com.dto.UserAuthDTO;
import com.opensymphony.xwork2.ActionSupport;
import com.service.UserAuthService;

public class UserSignUpAction extends ActionSupport 
{
	String userName;
	String password;
	String confirmPassword;
	String securityQue;
	String securityAns;
	String operation;
	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getConfirmPassword() {
		return confirmPassword;
	}
	public void setConfirmPassword(String confirmPassword) {
		this.confirmPassword = confirmPassword;
	}
	public String getSecurityQue() {
		return securityQue;
	}
	public void setSecurityQue(String securityQue) {
		this.securityQue = securityQue;
	}
	public String getSecurityAns() {
		return securityAns;
	}
	public void setSecurityAns(String securityAns) {
		this.securityAns = securityAns;
	}
	public String getOperation() {
		return operation;
	}
	public void setOperation(String operation) {
		this.operation = operation;
	}
	
	@Override
	public String execute() throws Exception 
	{
		UserAuthDTO dto = new UserAuthDTO();
		UserAuthService service = new UserAuthService();
		
		if("SignUp".equalsIgnoreCase(operation))
		{
			dto.setUserName(userName);
			dto.setPassword(password);
			dto.setConfirmPassword(confirmPassword);
			dto.setSecurityQue(securityQue);
			dto.setSecurityAns(securityAns);
			service.signUp(dto);
			return "SignUp";
		}
		return SUCCESS;
	}
}
